summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/common/settings.cpp19
-rw-r--r--src/yuzu/configuration/configure_general.cpp6
-rw-r--r--src/yuzu/main.cpp21
3 files changed, 31 insertions, 15 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp
index 66dffc9bf..6cbbea1b2 100644
--- a/src/common/settings.cpp
+++ b/src/common/settings.cpp
@@ -1,8 +1,11 @@
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
+#include <version>
#if __cpp_lib_chrono >= 201907L
#include <chrono>
+#include <exception>
+#include <stdexcept>
#endif
#include <string_view>
@@ -25,9 +28,19 @@ std::string GetTimeZoneString() {
if (time_zone_index == 0) { // Auto
#if __cpp_lib_chrono >= 201907L
const struct std::chrono::tzdb& time_zone_data = std::chrono::get_tzdb();
- const std::chrono::time_zone* current_zone = time_zone_data.current_zone();
- std::string_view current_zone_name = current_zone->name();
- location_name = current_zone_name;
+ try {
+ const std::chrono::time_zone* current_zone = time_zone_data.current_zone();
+ std::string_view current_zone_name = current_zone->name();
+ location_name = current_zone_name;
+ } catch (std::runtime_error& runtime_error) {
+ // VCRUNTIME will throw a runtime_error if the operating system's selected time zone
+ // cannot be found
+ location_name = Common::TimeZone::FindSystemTimeZone();
+ LOG_WARNING(Common,
+ "Error occurred when trying to determine system time zone:\n{}\nFalling "
+ "back to hour offset \"{}\"",
+ runtime_error.what(), location_name);
+ }
#else
location_name = Common::TimeZone::FindSystemTimeZone();
#endif
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp
index d74e663d4..2f55159f5 100644
--- a/src/yuzu/configuration/configure_general.cpp
+++ b/src/yuzu/configuration/configure_general.cpp
@@ -41,7 +41,8 @@ void ConfigureGeneral::SetConfiguration() {
ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background.GetValue());
ui->toggle_hide_mouse->setChecked(UISettings::values.hide_mouse.GetValue());
ui->toggle_controller_applet_disabled->setEnabled(runtime_lock);
- ui->toggle_controller_applet_disabled->setChecked(UISettings::values.controller_applet_disabled.GetValue());
+ ui->toggle_controller_applet_disabled->setChecked(
+ UISettings::values.controller_applet_disabled.GetValue());
ui->toggle_speed_limit->setChecked(Settings::values.use_speed_limit.GetValue());
ui->speed_limit->setValue(Settings::values.speed_limit.GetValue());
@@ -84,7 +85,8 @@ void ConfigureGeneral::ApplyConfiguration() {
UISettings::values.select_user_on_boot = ui->toggle_user_on_boot->isChecked();
UISettings::values.pause_when_in_background = ui->toggle_background_pause->isChecked();
UISettings::values.hide_mouse = ui->toggle_hide_mouse->isChecked();
- UISettings::values.controller_applet_disabled = ui->toggle_controller_applet_disabled->isChecked();
+ UISettings::values.controller_applet_disabled =
+ ui->toggle_controller_applet_disabled->isChecked();
// Guard if during game and set to game-specific value
if (Settings::values.use_speed_limit.UsingGlobal()) {
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 24e59f646..e8418b302 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1707,16 +1707,17 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p
system->SetFilesystem(vfs);
system->SetAppletFrontendSet({
- std::make_unique<QtAmiiboSettings>(*this), // Amiibo Settings
- (UISettings::values.controller_applet_disabled.GetValue() == true) ? nullptr :
- std::make_unique<QtControllerSelector>(*this), // Controller Selector
- std::make_unique<QtErrorDisplay>(*this), // Error Display
- nullptr, // Mii Editor
- nullptr, // Parental Controls
- nullptr, // Photo Viewer
- std::make_unique<QtProfileSelector>(*this), // Profile Selector
- std::make_unique<QtSoftwareKeyboard>(*this), // Software Keyboard
- std::make_unique<QtWebBrowser>(*this), // Web Browser
+ std::make_unique<QtAmiiboSettings>(*this), // Amiibo Settings
+ (UISettings::values.controller_applet_disabled.GetValue() == true)
+ ? nullptr
+ : std::make_unique<QtControllerSelector>(*this), // Controller Selector
+ std::make_unique<QtErrorDisplay>(*this), // Error Display
+ nullptr, // Mii Editor
+ nullptr, // Parental Controls
+ nullptr, // Photo Viewer
+ std::make_unique<QtProfileSelector>(*this), // Profile Selector
+ std::make_unique<QtSoftwareKeyboard>(*this), // Software Keyboard
+ std::make_unique<QtWebBrowser>(*this), // Web Browser
});
const Core::SystemResultStatus result{